﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;


namespace Park.Net.IService
{
    public interface IBaseServices<TEntity> where TEntity : class,new() 
    {
        public Task<bool> CreateAsync(TEntity entity);
        public Task<bool> UpdateAsync(TEntity entity);

        public Task<bool> DeleteAsync(TEntity entity);

        public Task<TEntity> FindOneAsync(int id);

        public Task<TEntity> FindOneAsync(Expression<Func<TEntity, bool>> exp);  //


        public Task<List<TEntity>> FindManyAsync(Expression<Func<TEntity, bool>> exp);

        public Task<List<TEntity>> FindAllAsync();
    }
}
